package month_03.day22;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Demo07 {
    static Object o=new Object();
    public static class T1 extends Thread{
        public T1(String name){
            super(name);
        }
        @Override
        public void run() {
            synchronized (o){
             log.info("in "+this.getName());
             Thread.currentThread().run();
            }
        }
    }
    public static void main(String[] args) throws InterruptedException {
        T1 t1=new T1("t1");
        t1.start();
        Thread.sleep(100);
        T1 t2 = new T1("t2");
        t2.start();
        t1.resume();
        t2.resume();
        t1.join();
        t2.join();

    }
}
